package br.com.mkmts.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import br.com.mkmts.model.constants.TipoAgendaEnum;

@Entity
@Table(name="tagenda")
public class AgendaEntity implements Serializable {

	private static final long serialVersionUID = -2717085774486544842L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "IDAgenda")
	private int id;
	@Column(name = "descricao")
	private String descricao;
	@Column(name = "dtInicio")
	private Date dataInicio;
	@Column(name = "dtFim")
	private Date dataFim;
	@Column(name = "DiaTodo")
	private boolean diaTodo;
	@Enumerated(EnumType.ORDINAL)
	@Column(name = "tipoAgenda")
	private TipoAgendaEnum tipoAgenda;

	// getters and setters
	public Date getDataFim() {
		return dataFim;
	}

	public void setDataFim(Date datafim) {
		this.dataFim = datafim;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public boolean isDiaTodo() {
		return diaTodo;
	}

	public void setDiaTodo(boolean diaTodo) {
		this.diaTodo = diaTodo;
	}

	public Date getDataInicio() {
		return dataInicio;
	}

	public void setDataInicio(Date dataInicio) {
		this.dataInicio = dataInicio;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		int hash = 5;
		hash = 37 * hash + this.id;
		return hash;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final AgendaEntity other = (AgendaEntity) obj;
		if (this.id != other.id) {
			return false;
		}
		return true;
	}

	public TipoAgendaEnum getTipoAgenda() {
		return tipoAgenda;
	}

	public void setTipoAgenda(TipoAgendaEnum tipoAgenda) {
		this.tipoAgenda = tipoAgenda;
	}
}